﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WeChatParking.Core.Payment.Alipay
{
   
    //支付宝页面跳转同步通知模型
   public class AlipayReturnModel
   {

       //====================基本参数=================
       /// <summary>
       /// 成功标识
       /// </summary>
       public string IsSuccess { get; set; }

       /// <summary>
       /// 签名方式
       /// </summary>
       public string SignType { get; set; }

       /// <summary>
       /// 签名
       /// </summary>
       public string Sign { get; set; }


       //====================业务参数=================

       /// <summary>
       ///商户网站唯一订单号
       /// </summary>
       public string OutTradeNo { get; set; }

       /// <summary>
       /// 商品名称 
       /// </summary>
       public string Subject { get; set; }

       /// <summary>
       /// 支付类型  
       /// </summary>
       public string PaymentType { get; set; }

       /// <summary>
       /// 接口名称
       /// </summary>
       public string Exterface { get; set; }

       /// <summary>
       /// 支付宝交易号  
       /// </summary>
       public string TradeNo { get; set; }

       /// <summary>
       /// 交易状态 成功的状态值：TRADE_FINISHED(普通)、TRADE_SUCCESS(高级)
       /// </summary>
       public string TradeStatus { get; set; }

       /// <summary>
       /// 通知校验ID
       /// </summary>
       public string NotifyID { get; set; }

       /// <summary>
       /// 通知时间
       /// </summary>
       public string NotifyTime { get; set; }

       /// <summary>
       /// 通知类型
       /// </summary>
       public string NotifyType { get; set; }

       /// <summary>
       /// 卖家支付宝账号
       /// </summary>
       public string SellerEmail { get; set; }

       /// <summary>
       /// 买家支付宝账号
       /// </summary>
       public string BuyerEmail { get; set; }

       /// <summary>
       /// 卖家支付宝用户号   
       /// </summary>
       public string SellerID { get; set; } 

       /// <summary>
       /// 买家支付宝用户号   
       /// </summary>
       public string BuyerID { get; set; }

       /// <summary>
       /// 交易金额   
       /// </summary>
       public string TotalFee { get; set; }

       /// <summary>
       /// 商品描述   
       /// </summary>
       public string Body { get; set; }

       /// <summary>
       /// 公用回传参数   
       /// </summary>
       public string ExtraCommonParam { get; set; }

       /// <summary>
       /// 信用支付购票员的代理人ID   
       /// </summary>
       public string AgentUserID { get; set; }

       public AlipayReturnModel(Dictionary<string,string> parameters)
       {
           IsSuccess = parameters["is_success"];
           SignType = parameters["sign_type"];
           Sign = parameters["sign"];

           OutTradeNo = parameters.ContainsKey("out_trade_no") == false ? null : parameters["out_trade_no"];
           Subject = parameters.ContainsKey("subject") == false ? null : parameters["subject"];
           PaymentType = parameters.ContainsKey("payment_type") == false ? null : parameters["payment_type"];
           Exterface = parameters.ContainsKey("exterface") == false ? null : parameters["exterface"];
           TradeNo = parameters.ContainsKey("trade_no") == false ? null : parameters["trade_no"];
           TradeStatus = parameters.ContainsKey("trade_status") == false ? null : parameters["trade_status"];
           NotifyID = parameters.ContainsKey("notify_id") == false ? null : parameters["notify_id"];

           NotifyTime = parameters.ContainsKey("notify_time") == false ? null : parameters["notify_time"];

           NotifyType = parameters.ContainsKey("notify_type") == false ? null : parameters["notify_type"];
           SellerEmail = parameters.ContainsKey("seller_email") == false ? null : parameters["seller_email"];
           BuyerEmail = parameters.ContainsKey("buyer_email") == false ? null : parameters["buyer_email"];
           SellerID = parameters.ContainsKey("seller_id") == false ? null : parameters["seller_id"];
           BuyerID = parameters.ContainsKey("buyer_id") == false ? null : parameters["buyer_id"];
           TotalFee = parameters.ContainsKey("total_fee") == false ? null : parameters["total_fee"];
           Body = parameters.ContainsKey("body") == false ? null : parameters["body"];
           ExtraCommonParam = parameters.ContainsKey("extra_common_param") == false? null : parameters["extra_common_param"];
           AgentUserID = parameters.ContainsKey("agent_user_id") == false ? null : parameters["agent_user_id"];
       } 

      


    
    }
}
